package com.mz.admin.controller.emergency;

import com.mz.common.core.domain.AjaxResult;
import com.mz.emergency.domain.AdmissionAssessment;
import com.mz.emergency.service.impl.AdmissionAssessmentServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


/**
 * 留抢管理Controller
 *
 * @author zzq
 * @date 2025-05-07
 */
@Tag(name = "StayGrabController", description = "留抢管理")
@RestController
@RequestMapping("/emergency/stayGrab")
@RequiredArgsConstructor
public class StayGrabController {

    private final AdmissionAssessmentServiceImpl admissionAssessmentService;

    /**
     * 查询入院护理评估详情根据诊断id
     */
    @Operation(summary = "查询入院护理评估详情根据诊断id")
    @GetMapping(value = "/getAdmissionAssessment/{diagnosisId}")
    public AjaxResult getAdmissionAssessment(@PathVariable("diagnosisId") String diagnosisId) {
        return AjaxResult.success(admissionAssessmentService.selectUnitMemberByDiagnosisId(diagnosisId));
    }

    /**
     * 新增入院护理评估
     */
    @Operation(summary = "新增入院护理评估")
    @PostMapping("/addAdmissionAssessment")
    public AjaxResult addAdmissionAssessment(@RequestBody @Validated AdmissionAssessment admissionAssessment) {
        return AjaxResult.success(admissionAssessmentService.insertUnitMember(admissionAssessment));
    }

}
